//
// Created by tanzx on 2023/12/8.
//
#include <iostream>
#include "Point.h"

using namespace std;

//call test_assignment
//11  22
//1  2
//call test_assignment end~!
void test_point() {
    cout << "call test_assignment" << endl;
    Point p1(1, 2);  // 定义并初始化一个 Point 类型的对象 p1
    Point p2 = p1;   // 将对象 p1 的值赋给对象 p2
    p1.setX(11);
    p1.setY(22);
    cout << p1.getX() << "  " << p1.getY() << endl;
    cout << p2.getX() << "  " << p2.getY() << endl;
    cout << "call test_assignment end~!" << endl;
}

//call test_assignment_point
//11  22
//11  22
//call test_assignment_point end~!
void test_copy_point(){
    cout << "call test_assignment_point" << endl;
    Point p1(1, 2);  // 定义并初始化一个 Point 类型的对象 p1
    Point *p2 = &p1;   // 将对象p1 的地址值赋给对象 p2的指针
    p1.setX(11);
    p1.setY(22);
    cout << p1.getX() << "  " << p1.getY() << endl;
    cout << p2->getX() << "  " << p2->getY() << endl;
    cout << "call test_assignment_point end~!" << endl;
}